<template>
    <div>

        <a href="/AddMmeber">新增会员</a>
        <h1>会员列表</h1>
        <table>
           <thead>
            <tr>
                <td>编号</td>
                <td>姓名</td>
                <td>密码</td>
            </tr>
           </thead>
           <tbody>
            <tr v-for="a in data">
                <td>{{ a.id }}</td>
                <td>{{a.name}}</td>
                <td>{{a.password}}</td>
            </tr>
           </tbody>
        </table>

    </div>
</template>

<script setup lang="ts">

import { ref,onMounted } from 'vue'
import axios from 'axios'

//model
const data=ref([{
    "id": 0,
    "name": "",
    "password": ""
  }]);

const getdata=()=>{
    //axios.get("",{params:{}}).then(res=>{})
    axios.get("https://localhost:7139/api/Member/GetMembers").then(res=>{
        data.value = res.data;
    })
}


onMounted(()=>{
    getdata()
})


</script>

<style scoped>

</style>